<?php get_header(); ?>


<?php include (TEMPLATEPATH . '/framework/includes/get_pages_top.php'); ?>

<div class="page_container_bg">
	<div class="page_container clearfix">
		<div class="page_content">
			<div class="page_content_text">
			
				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

			
					<?php the_content(); ?>  
					<?php comments_template( '', true ); ?>
					
				<?php endwhile; endif;  ?>
			
			</div>
		</div>
		
		<div class="page_right_content">
			<?php 
				wp_reset_query();
				if($post->post_parent) {
					$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->post_parent."&echo=0");
				} else {
					$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->ID."&echo=0");
				}
				if ($children) { 
			?>
			<div class="page_right_navigation">
	
				<?php wp_reset_query(); if(intval($post->post_parent)>0){	while(intval($post->post_parent)>0)	$post = get_post($post->post_parent);	} echo "<h3>".get_the_title($post->post_parent)."</h3>";  wp_reset_query(); ?>
			
				<!-- begin navigation categories -->
				<ul>
					<?php echo create_page($post);?>
				</ul>
				<!-- begin navigation categories -->

			</div>
			<?php } ?>
			
			<div class="page_right_sidebars">	
				<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Page Sidebars')) {} else { } ?>
				<?php get_sidebar(); ?>
			</div>
			
		</div>

	</div>
	
</div>




<?php get_footer(); ?>
